#pragma once

typedef enum _UserStatus
{
    CanContinue = 1,
    OutOfSchedule,
    WeekExceeded,
    DayExceeded
} UserStatus;

class DayTimeTable
{
public:
    static const int TABLE_SIZE = 48;
protected:
    BOOL m_tbl[TABLE_SIZE];
    UINT m_time;
public:
    DayTimeTable(void);
    ~DayTimeTable(void);

    UINT Time() { return m_time; }
    void Time(UINT time) { m_time = time; }

    BOOL Allowed(int idx);
    void Allow(int idx, BOOL b);
    int ReadConfig(const BYTE* config);
    int SaveConfig(BYTE* config);
    UserStatus HasToStop(SYSTEMTIME& st);
    int TimeRemainsSchedule(SYSTEMTIME& st);
};
